package com.gisocn.onemap.ui.popupwindow;

import android.content.Context;
import android.graphics.drawable.BitmapDrawable;
import android.view.View;
import android.widget.ImageView;
import android.widget.PopupWindow;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.esri.core.geometry.Geometry;
import com.gisocn.onemap.model.Collection;
import com.gisocn.onemap.model.DynamicInfo;
import com.gisocn.onemap.sgzx.R;
import com.gisocn.onemap.ui.adapter.DynamicQueryInfoAdapter;
import java.util.ArrayList;
import java.util.List;

/* loaded from: classes2.dex */
public class DynamicDetailInfoPopWindow extends PopupWindow {
    private DynamicQueryInfoAdapter adapter;
    private ArrayList<Collection> collectionList = new ArrayList<>();
    private Context context;
    private String displayField;
    private Geometry geometry;
    private int height;
    boolean isCollection;
    ImageView ivCollection;
    private String layerName;
    private List<DynamicInfo.DetaileInfo> list;
    private int pkId;
    private int width;

    public DynamicDetailInfoPopWindow(Context context, List<DynamicInfo.DetaileInfo> list, Geometry geometry, int i, int i2, String str, String str2) {
        this.context = context;
        this.list = list;
        this.width = i;
        this.height = i2;
        this.geometry = geometry;
        this.layerName = str;
        this.displayField = str2;
        initView();
    }

    private void initView() {
        this.isCollection = false;
        View inflate = View.inflate(this.context, R.layout.popup_query_land_info, null);
        setContentView(inflate);
        setWidth(this.width);
        setHeight(this.height);
        setFocusable(false);
        setOutsideTouchable(false);
        setBackgroundDrawable(new BitmapDrawable());
        this.ivCollection = (ImageView) inflate.findViewById(R.id.iv_menu);
        RecyclerView recyclerView = (RecyclerView) inflate.findViewById(R.id.recycle_land_info);
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this.context);
        linearLayoutManager.setOrientation(1);
        recyclerView.setLayoutManager(linearLayoutManager);
        DynamicQueryInfoAdapter dynamicQueryInfoAdapter = new DynamicQueryInfoAdapter(this.list);
        this.adapter = dynamicQueryInfoAdapter;
        recyclerView.setAdapter(dynamicQueryInfoAdapter);
        this.ivCollection.setVisibility(0);
        Glide.with(this.context).load(Integer.valueOf((int) R.mipmap.icon_uncollect)).into(this.ivCollection);
        ((TextView) inflate.findViewById(R.id.tv_close)).setOnClickListener(new View.OnClickListener() { // from class: com.gisocn.onemap.ui.popupwindow.DynamicDetailInfoPopWindow.1
            @Override // android.view.View.OnClickListener
            public void onClick(View view) {
                DynamicDetailInfoPopWindow.this.dismiss();
            }
        });
    }

    public void upData(ArrayList<DynamicInfo.DetaileInfo> arrayList, String str, String str2, Geometry geometry) {
        this.list.clear();
        this.list.addAll(arrayList);
        this.layerName = str;
        this.displayField = str2;
        this.geometry = geometry;
        this.isCollection = false;
        this.adapter.notifyDataSetChanged();
        Glide.with(this.context).load(Integer.valueOf((int) R.mipmap.icon_uncollect)).into(this.ivCollection);
    }
}
